from flask import Flask

app = Flask(__name__)


# 根路由
@app.route('/')
def hello():
    return 'Hello World!'


# 动态路由
@app.route('/user/<username>')
def show_user(username):
    return f'User: {username}'


@app.route('/post/<int:post_id>')
def show_post(post_id):
    return f'Post {post_id}'


if __name__ == '__main__':
    app.run(debug=True, host='0.0.0.0', port=5000)
    # app.run(debug=True)
